import React, { useEffect, useState } from 'react';
import { Table } from 'antd';
import {getMyStudent}from '../../api/myStudent'

const columns = [
  {

    dataIndex: 'address',
  },
  {
    title: '学生',
    dataIndex: 'name',
    width: 150,
  },
  {
    title: '上课时间',
    dataIndex: 'age',
    width: 150,
  },
  {
    title: '课时费',
    dataIndex: 'address',
  },
  {
    title: '出勤',
    dataIndex: 'address',
  },
  {
    title: '备注',
    dataIndex: 'address',
  },
  
];
const data = [];
for (let i = 1; i < 30; i++) {
  data.push({
    key: i,
    name: `Edward King ${i}`,
    age: 32,
    address: ` ${i}`,
  });
}
const App = () => {
  const [sup ,setsup]=useState({})
  useEffect(()=>{
    getMyStudent().then(res=>{
      // console.log(res.data.data[0].name);
      setsup(res.data.data[0].name)
    })
  })
  return(
  
  
  <Table
    columns={columns}
    dataSource={data}
    pagination={{
      pageSize: 50,
    }}
    scroll={{
      y: 240,
    }}
  />
);
  }
export default App;